package com.cn.qtms.entity;

import com.cn.qtms.base.entity.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Name:TsAttachment
 * @Description: 附件
 * @Author: Neil
 * @Date: 2019-09-09 11:36
 **/
@Entity
@Table(name="ts_attachment")
@Getter
@Setter
@NoArgsConstructor
public class TsAttachment extends BaseEntity {

    @Column(name="related_table",columnDefinition="varchar(50) COMMENT '关联的表'")
    private String relatedTable;

    @JsonSerialize(using = ToStringSerializer.class)
    @Column(name="related_id",columnDefinition="bigint(50) COMMENT '关联的记录'")

    private Long relatedId;

    @Column(name="file_name",columnDefinition="varchar(255) COMMENT '保存文件名'")
    private String fileName;

    @Column(name="original_name",columnDefinition="varchar(255) COMMENT '原始文件名'")
    private String originalName;

    @Column(name="suffix",columnDefinition="varchar(10) COMMENT '文件后缀名'")
    private String suffix;

    @Column(name="file_type",columnDefinition="varchar(20) COMMENT '文件类型'")
    private String fileType;
}
